1. Field of the Invention
The present invention relates to a data transmitting/receiving method and a device for an encoder, for transmitting and receiving data detected by an encoder in predetermined cycles. In particular, the present invention relates to a data transmitting/receiving method and a device for an encoder, which are capable of transmitting positional data within a control cycle in a measuring device using a sampling control system for controlling a position or a speed at predetermined time intervals. The present invention is suitable for use in an linear encoder or a rotary encoder (hereinafter, referred to collectively as an encoder) of a control device such as a three-dimensional coordinate measuring machine, a machine tool, an image measuring device, and a shape measuring device.
2. Description of the Related Art
Conventionally, in a control device such as a three-dimensional coordinate measuring machine, a machine tool, an image measuring device, and a shape measuring device, a so-called incremental pulse system is mainly used as a signal output form of an encoder for detecting a position or a speed. According to this system, as shown in FIG. 1, at each positional change, an incremental pulse is output as a counter pulse from an encoder 10 to a transmission line 30. A count value is updated by an UP/DOWN (UP/DN) counter 22 of a control device 20 each time the counter pulse is output. A frequency of the incremental pulse is limited to about 4 MHz (an edge interval is ⅛ MHz) in practical use because of the constraint on the transmission line 30 for transmitting the incremental pulse.
In the incremental pulse system, the relation between the maximum driving speed of the control device 20 and the counting resolution of the encoder 10 is expressed by the following formula (1). If the counting resolution of the encoder 10 is increased, the maximum driving speed of the control device 20 is disadvantageously restrained.8 [MHz]≦maximum driving speed/counting resolution  (1)
As described above, the incremental pulse system suffers from the constraint on the driving speed/counting resolution.
Therefore, in recent encoders for a digital control device, a serial data transmission system is more and more widely used (see Japanese Patent Laid-Open Publication Nos. Hei 9-5114, Hei 8-247788, and Hei 10-160516). According to this method, as shown in FIG. 2, an UP/DN counter 12, a data latch circuit 14, and a data conversion circuit 16 for converting a parallel signal into a serial signal are provided in the encoder 10. Positional data required for control by the control device 20 is transmitted from the encoder 10 in a serial sequence at each of the predetermined time intervals (control cycles) so that a serial data receiving circuit 24 of the control device 20 receives the data at each of the predetermined time intervals.
In the case of the former incremental pulse transmission system, only one incorrect transmission of a pulse due to an error, a noise or the like in the encoder 10 makes a subsequent measured position contain an error. In order to prevent such an error, the latter serial data transmission system is used to transmit the positional data itself. With the serial data transmission system, since positional or speed data required for each control cycle is received in serial communication, the data transmission line is not restrained any more. Therefore, the position can be detected with the maximum capacity of the encoder, so that high-speed driving and high resolution can be realized.
On the other hand, the maximum value of an incremental position corresponding to a deviation is determined by a product of the allowable maximum speed of the encoder and the maximum sampling time interval. Normally, in the case of the transmission of positional information, as shown in FIG. 3, a bit length to be transmitted is shorter in the case where, for example, deviation data requiring only 8-bit binaries is transmitted than in the case where, for example, positional data requiring 48 bit binaries is transmitted. Conversely, the transmission of positional data has a problem in that transfer time is disadvantageously increased than in the transmission of deviation data.
It is also conceivable to transmit deviation data in the serial transmission system. In this case, however, a similar problem to that inherent to the incremental pulse transmission system arises; that is, only one incorrect transmission of a pulse makes a subsequent measured position contain an error.
Moreover, in the case of the transmission of deviation data, unless positional data is transmitted at least once, the receiving side cannot calculate the position measured by the encoder from the deviation data. Therefore, in the case of cyclic transmission of deviation data, it is necessary to transmit the positional data between the transmissions of deviation data. Therefore, time cannot be spared long enough to transmit the positional data. As a result, there is a problem that the transmission of deviation data should be interrupted to transmit positional data or a time interval between the transmissions of deviation data should be set sufficiently long.
On the other hand, the encoder is used not only to control a moving object by the control device 20 but also to detect the position at the generation of a trigger signal. In such a case, in a measuring device (for example, a three-dimensional coordinate measuring machine) equipped with a control device including the former incremental pulse transmission system encoder, a digital signal processing circuit (DSP) (for example, CPU) 26 at the upper level in a sampling control system includes latch circuits 28 and 29 respectively for a control cycle of a position or a speed and for a trigger signal from an external sensor (for example, a touch sensor) 40 so as to latch and fetch data from the UP/DN counter 22 in accordance with the processing. More specifically, data for control is regularly latched in the latch circuit 28, whereas data for measurement is latched in the latch circuit 29 by a trigger signal generated from the external sensor 40.
As described above, however, the constraint on driving speed/counting resolution, which is inherent to the incremental pulse transmission system, is brought about.
On the other hand, in the latter serial data transmission system, there will arise no problem if the system is used for a device merely controlling a position or speed. However, this system has a problem in that the device cannot acquire any positional data at the generation of a trigger signal from the external sensor in addition to data for control at each predetermined cycle.